import http from '@/utils/request'

const umApiBefore = '/web/um'
const webApiBefore = '/web'

export const um = {
  getUserApiTokenAPI: () => {
    return http.get(`${webApiBefore}/api/token/secret`)
  },
  getUserConfigInfoAPI: tenantCode => {
    return http.get(`${webApiBefore}/api/token/${tenantCode}`)
  },
  updateUserConfigAPI: params => {
    return http.post(`${webApiBefore}/api/token/save`, params)
  },
  poststatRouteAPI: params => {
    return http.get(`${umApiBefore}/sys/log/pages/save-mq`, { params })
  },

  postErrorAPI: params => {
    return http.post(`${umApiBefore}/sys/log/client/error`, params)
  },
  checkTemplateName: params => {
    return http.post(`${umApiBefore}/tenant/template/checkname`, params)
  },
  getAssignRoleList: params => {
    return http.get(`${umApiBefore}/sys/role/assign/list-by-role?${params}`)
  },
  getRoleAssignListApi: params=> {
    return http.get(`${umApiBefore}/sys/role/client/getRoleAssignList?${params}`)
  },
  getUserRegSourceList: params => {
    return http.get(`${umApiBefore}/sys/user/list/selectByRegSource`, { params })
  },
  checkConsultantName: params => {
    return http.get(`${umApiBefore}/sys/user/checkUsername`, { params })
  },
  getClientThreeSelect: () => {
    return http.get(`${umApiBefore}/sys/tenant/thirdPartyName`)
  }
}

export default um
